package cn.jietuo.first.class01;

/**
 * @author zhangx & jietuo_zx@163.com
 * @version 1.0
 * @date 2020/5/27
 * @description:
 * 不用额外变量交换两个数
 * 使用异或实现
 */
public class Code08_ExchangeTwoNum {

    public static void main(String[] args) {
        int a = 10;
        int b = 40;

        a = a ^ b;
        b = a ^ b;
        a = a ^ b;

        System.out.println("a :" + a);
        System.out.println("b :" + b);
    }
}
